package com.pactera.jep.service.sys.web.controller;

import com.pactera.jep.core.code.LogType;
import com.pactera.jep.core.code.OperateType;
import com.pactera.jep.core.entity.Log;
import com.pactera.jep.core.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    @PostMapping("/addLog")
    public void addLog(@RequestBody Log log) {
        logService.addLog(log);
    }

    @PostMapping("/addLogMethod")
    public void addLog(String logContent, LogType logType, OperateType operateType) {
        logService.addLog(logContent,logType,operateType);
    }
}
